﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using WalkingTec.Mvvm.Core;
using System.Text.Json.Serialization;
using TyMES.Model;
using TyMES.Model.BaseInformation;

namespace TyMES.Model.BaseInformation
{
    /// <summary>
    /// 员工管理
    /// </summary>
	[Table("T_Persons")]
    [SoftKey(nameof(Person.StationCode))]
    [Display(Name = "_Model.Person")]
    public class Person : TopBasePoco
    {
        [Display(Name = "_Model._Person._PersonCode")]
        [StringLength(100, ErrorMessage = "Validate.{0}stringmax{1}")]
        [Comment("员工编号")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public string PersonCode { get; set; }
        [Display(Name = "_Model._Person._PersonName")]
        [Comment("员工名称")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public string PersonName { get; set; }
        [Display(Name = "_Model._Person._PhoneNumber")]
        [Comment("手机")]
        public string PhoneNumber { get; set; }
        [Display(Name = "_Model._Person._Gender")]
        [Comment("性别")]
        public PersonGenderEnum? Gender { get; set; }
        [Display(Name = "_Model._Person._Address")]
        [Comment("地址")]
        public string Address { get; set; }
        [Display(Name = "_Model._Person._EmpSkills")]
        [Comment("技能级别")]
        public string EmpSkills { get; set; }
        [Display(Name = "_Model._Person._StationCode")]
        [Comment("工位编码")]
        [NotMapped]
        [CanNotEdit]
        public Station StationCode { get; set; }
        [Display(Name = "_Model._Person._StationCode")]
        [Comment("工位编码")]
        public string StationCodeId { get; set; }
        [Display(Name = "_Model._Person._LineCode")]
        [Comment("产线编码")]
        [NotMapped]
        public Line LineCode { get; set; }
        [Display(Name = "_Model._Person._LineCode")]
        [Required(ErrorMessage = "Validate.{0}required")]
        [Comment("产线编码")]
        public string LineCodeId { get; set; }

	}

}
